<?php
/**
 * Author: Phong Vu
 * Created: 20141026
 * Description: a collection to work with stadium place
 */	

class StadiumPlace extends \Phalcon\Mvc\Collection 
{
		
	//Member	
	public $Name;
	public $Manager;
	public $Phone;
	public $Mobile;
	public $Status;
	public $Id;
	
	/*
	 * There are six part for address
	 * location number
	 * location street
	 * location ward
	 * location district
	 * location province
	 * location country
	 */ 
	public $Address;
	/*
	 * working time for stadium place
	 * open: open time
	 * close: close time
	 */
	public $OpenTime;
	
	public $Price;
	/*
	 * There are some stadium type:
	 * 1 - Football - dedicate
	 * 2 - Tennis - dedicate
	 * 3 - Badminton - dedicate
	 * 4 - Mixed: combine many types of sport 
	 * 5 - And more...
	 */
	public $StadiumType;
	
	/*
	 * stadium's collection of place
	 * There is a collection that is use for storing all references of stadiums
	 */
	public $StadiumSet;
	/*
	 * features collection of Stadium place
	 */
	public $FeatureSet;
	/*
	 * the registration's code for business
	 */
	public $BusinessCode;
	/*
	 * Status of activation of Stadium
	 */
	public $ActivateStatus;
	/*
	 * This is a coordinate of stadium place, include:
	 * Latitude
	 * Longitude
	 */
	public $Coordinates;
	
	/*
	 * temp manager of stadium place that is suggested by our users
	 */
	public $ManagerTemp;
	/*
	 * this is a code to indentify type of entity, it might be
	 * StadiumPlace
	 * User
	 * FootballStadium
	 * BadmintonStadium
	 * TennisStadium
	 */
	public $EntityCode;
	
		
	//Opentime Setter				
	public function setOpenTime($open = "07:00", $close = "22:00") 
	{
		$this->OpenTime = array("open" => $open, "close" => $close);
	}
	
	//Coordinates Setter
	public function setCoordinates($latitude = "10.762622", $longitude = "106.660172") 
	{
		$this->Coordinates = array("latitude" => $latitude, "longitude" => $longitude);
	}
	
	/*
	 * Address Setter
	 */
	public function setAddress($locNum = null, $locStreet="", $locWard="", $locDistrict="", $locProvince="", $locCountry="vn")
	{
		$this->Address = array('locNum' => $locNum, 'locStreet'=>$locStreet, 'locWard'=>$locWard, 'locDistrict'=>$locDistrict, 'locProvince'=>$locProvince, 'locCountry'=>$locCountry);
	}
	
	/*
	 * Add stadium to set of stadiums
	 */
	 public function addStadium($arrStadium)
	 {
	 	$this->update(array("_id"=>$this->Id), array("$push"=>array("id"=>"123")));
	 }
}
